package com.itheima.homework;

public class DemoTeacher {
    public static void main(String[] args) {
            Teacher t = new Teacher();
            t.setNum(12);
            t.setName("黄");
            t.show();
            Teacher t2 = new Teacher(18,"张");
            t2.show();

    }
}

class Teacher{
    private int num;
    private String name;

    public Teacher(){}

    public Teacher(int num,String name){
        this.num = num;
        this.name = name;
    }

    public void setNum(int num){
        this.num = num;
    }
    public int getNum(){return num;}

    public void  setName(String name){
        this.name = name;
    }
    public String getName(){return name;}

    public void show(){
        System.out.println("工号为" + num + "的" + name + "老师正在讲课");
    }
}
